<?php 
/**
 * The settings panel is based on the code of the tarski theme (http://tarskitheme.com/)
 * by Ben Eastaugh and Chris Sternal-Johnson.
 *
 * @package dkret3
 * @since 3.6
 */

$data = wp_get_theme();
?>

<div id="dkret-settings" class="wrap metabox-holder <?php if (  is_rtl() ) : echo " rtl"; endif; ?>">

    <form action="<?php echo admin_url( 'admin-post.php?action=dkret_update_options' ); ?>" method="post">
        <?php wp_nonce_field( 'theme-settings' ); ?>
        
        <div id="dkret-settings-header">

            <?php screen_icon(); ?>
            <h2><?php _e( 'Theme Settings', 'dkret' ); ?></h2>
            
            <p id="dkret-save-settings">
                <input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e( 'Save Changes', 'dkret' ); ?>" />
            </p>

            <p id="dkret-info">
                <a href="<?php echo esc_attr( $data['URI'] ); ?>"><?php _e( 'Download dkret3', 'dkret' ); ?></a>
            </p>
        
            <div class="clearer"></div>
        </div>

        <?php if ( isset( $_GET['updated'] ) ) : ?>
            <div class="updated fade below-h2">
                <p><?php printf( __( 'Settings saved. %s', 'dkret' ),'<a href="' . user_trailingslashit( home_url() ) . '">' . __( 'View site &rsaquo;', 'dkret' ) . '</a>' ); ?></p>
            </div>
        <?php elseif ( isset( $_GET['defaults'] ) ) : ?>
            <div class="updated fade below-h2">
                <p><?php printf( __( 'Defaults loaded. %s', 'dkret' ),'<a href="' . user_trailingslashit( home_url() ) . '">' . __( 'View site &rsaquo;', 'dkret' ) . '</a>' ); ?></p>
            </div>
        <?php endif; ?>

        <div class="span">
            <div class="postbox">
                <h3 class="hndle"><?php printf( __( 'About %s', 'dkret' ), esc_attr( $data['Name'] ) ); ?></h3>
                <div class="inside">

                    <p class="theme_information">
                        <?php printf( __( '<strong>Version:</strong> %s', 'dkret' ), esc_attr( $data['Version'] ) ) ; ?>
                        <br />
                        <?php printf( __( '<strong>Author:</strong> %s', 'dkret' ), $data['Author'] ); ?>
                    </p>

					<p><?php _e( 'A flexible theme for WordPress developed by Joern Kretzschmar.', 'dkret' ) ?></p>
					<p><?php _e( 'Get support at the <a href="http://wordpress.org/tags/dkret3?forum_id=5">official WordPress forum</a>.', 'dkret' ); ?></p>

                </div>
            </div>
        </div>

        <div class="span">
            <div class="postbox">
                <h3 class="hndle"><?php _e( 'Header', 'dkret' ); ?></h3>
                <div class="inside">
                    <div class="option borderless">
                        <?php
                            $image = HEADER_IMAGE;
                        ?>

                        <?php if ( get_theme_mod( 'header_textcolor' ) != 'blank' && !defined( 'NO_HEADER_TEXT' ) ) : ?>
                            <div class="title" style="color: #<?php header_textcolor(); ?>;"><?php bloginfo( 'blogtitle' ); ?></div>
                        <?php endif; ?>
                        
                        <label for="recent-header-image">
                            <img name="recent_header" id="recent-header-image" src="<?php echo $image ?>" alt="" width="350" />
                       </label>
                    </div>

                    <div class="suboption">
                        <label for="opt-header-link">
                            <input name="header_link" id="opt-header-link" type="checkbox" <?php checked( get_dkret_option( 'header_link' ), 1 ); ?> value="1" />
                            <?php _e( 'Link header image to blog home', 'dkret' ); ?>
                        </label>
						<label for="opt-gallery-link">
							<input name="gallery_link" id="opt-gallery-link" type="checkbox" <?php checked( get_dkret_option( 'gallery_link' ), 1 ); ?> value="1"  />
							<?php _e( 'Show the Gallery Link', 'dkret' ); ?>
						</label>

                    </div>
                    
                    <div class="details">
                        <p><?php printf( __('You can upload and delete a header image on the <a href="%s">Custom Header Page</a>.', 'dkret' ),
                                    home_url() . '/wp-admin/themes.php?page=custom-header' ); ?></p>
                    </div>

                </div>
            </div>
        </div>

        <div class="span">
            <div class="postbox">
                <h3 class="hndle"><?php _e( 'Navigation', 'dkret' ); ?></h3>
                <div class="inside">
                    <div class="option borderless">
                        <label for="opt-show-navigation">
                            <input name="show_navigation" id="opt-show-navigation" type="checkbox" <?php checked( get_dkret_option( 'show_navigation' ), 1 ); ?> value=1 />
                            <?php _e('Show the Navigation','dkret') ?>
                        </label>
                    </div>
                    <div class="option borderless">
                        <label for="opt-rss-link">
                            <input name="rss_link" id="opt-rss-link" type="checkbox" <?php checked( get_dkret_option( 'rss_link' ), 1 ); ?> value="1"  />
                            <?php _e( 'Show the RSS-Link', 'dkret' ); ?>
                        </label>
                    </div>
                    <div class="details">
                        <p><?php printf( __( 'You can add pages, categories and static links to the navigation at the <a href="%1$s" title="Menu">Menu Page</a>.', 'dkret' ),
                                    home_url() . '/wp-admin/nav-menus.php' ); ?></p>
                    </div>
                </div>
            </div>
        </div>

        <div class="span">
            <div class="postbox">
                <h3 class="hndle"><?php _e( 'Miscellaneous Options', 'dkret' ); ?></h3>
                <div class="inside">
					<label for="opt-preview-comments">
                        <input name="preview_comments" id="opt-preview-comments" type="checkbox" <?php checked( get_dkret_option( 'preview_comments' ), 1 ); ?> value="1"  />
                        <?php _e( 'Show Comment Preview', 'dkret' ); ?>
                    </label>
                    <label for="opt-validate-comments">
                        <input name="validate_comments" id="opt-validate-comments" type="checkbox" <?php checked( get_dkret_option( 'validate_comments' ), 1 ); ?> value="1"  />
                        <?php _e( 'Validate Commentform', 'dkret' ); ?>
                    </label>
                    <label for="opt-summary">
                        <input name="summary" id="opt-summary" type="checkbox" <?php checked( get_dkret_option( 'summary' ), 1 ); ?> value="1"  />
                        <?php _e( 'Show search and archive pages as Summary', 'dkret' ); ?>
                    </label>
                    <label for="opt-remove-settings">
                        <input name="remove_settings" id="opt-remove-settings" type="checkbox" <?php checked( get_dkret_option( 'remove_settings' ), 1 ); ?> value="1"  />
                        <?php _e( 'Remove all settings after theme switch', 'dkret' ); ?>
                    </label>
                    <div class="details">
                        <p><?php _e( "You should check the last option only if you permanently want to delete the theme.", 'dkret' ); ?></p>
                    </div>
                </div>
            </div>
        </div>

        <div class="span">
            <div class="postbox">
                <h3 class="hndle"><?php _e( 'Footer Text', 'dkret' ); ?></h3>
                <div class="inside">
                    <div class="option footer-text borderless">
                        <label for="opt-footer-text">
                            <p><textarea class="widefat" rows="2" cols="30" id="opt-footer-text" name="footer_text"><?php esc_attr_e( get_dkret_option( 'footer_text' ) ); ?></textarea></p>
                        </label>
                    </div>
                    <div class="details">
                        <p>
                            <?php _e( "Add Text or HTML Code and use the following Shortcodes for convenient adjustments:", 'dkret'); ?>
                            <br/>
                            <span><code>[theme-link]</code> <code>[theme-version]</code> <code>[wp-link]</code> <code>[site-link]</code> <code>[the-year]</code> <code>[check-html]</code> <code>[check-css]</code> <code>[query-count]</code> <code>[separator]</code>.</span>
                        </p>
                    </div>
                </div>
            </div>
        </div>

        <div class="span">
            <p>
                <input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e( 'Save Changes', 'dkret' ); ?>" />
                <input type="submit" class="button-secondary" name="restore-defaults" value="<?php esc_attr_e( 'Revert to Theme Defaults', 'dkret' ); ?>" />
            </p>
        </div>
    </form>

    <div class="clearer"></div>
</div>